#ifndef CAMERA_H
#define CAMERA_H

#include <QWidget>
#include <QApplication>
#include<QMouseEvent>
//摄像头
#include <QCameraImageCapture>
#include <QCamera>
#include<QCameraViewfinder>

namespace Ui {
class camera;
}

class camera : public QWidget
{
    Q_OBJECT

private:
    bool m_moveing2=false;//表示窗口是否在鼠标的操作下移动
    bool m_IsComboxNeedChange=false;
    QPoint m_lastPos;//上一次的鼠标位置

protected:
    //用于鼠标拖动窗口的鼠标事件
    void mousePressEvent(QMouseEvent*event);//鼠标摁住
    void mouseMoveEvent(QMouseEvent*event);//鼠标移动
    void mouseReleaseEvent(QMouseEvent*event);//鼠标松开

public:
    explicit camera(QWidget *parent = nullptr);
    ~camera();

private slots:
    void on_pushButton1_clicked();

    void on_imageCaptured(int id, const QImage &preview);


    void on_pushButton_clicked();

private:
    Ui::camera *ui;
    //创建两个摄像头对象
    QCamera *camera1;
       QCameraViewfinder *viewfind;
       QCameraImageCapture *imageCapture;

};

#endif // CAMERA_H
